{include file="public/header" /}

<div class="container mtb-15">
	{include file="user_setting/left_nav" /}

	<div class="user-setting col-md-10 form-horizontal">
		<h2 class="h3 post-title">个人资料</h2>
		<div class="row mt-30">
			<div class="col-md-3 col-md-push-9 text-center">
				<a href="{:url('user_setting/change_head')}"><img src="{:img($user['head_url'], 300, 300)}" width="128" /></a>
			</div>
			<div class="col-md-8 col-md-pull-3">
				<form action="" method="post" class="ajax-form">
					<div class="form-group ">
						<label for="name" class="required control-label col-sm-3">姓名</label>
						<div class="col-sm-9">
							<input name="realname" type="text" maxlength="32" placeholder="姓名" class="form-control" value="{$user['realname']}">
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">性别</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input name="sex" type="radio" value="1" {$user['sex'] == 1 ? 'checked' : ''}>男
							</label>
							<label class="radio-inline">
								<input name="sex" type="radio" value="2" {$user['sex'] == 2 ? 'checked' : ''}>女
							</label>
						</div>
					</div>
					<div class="form-group ">
						<label for="name" class="required control-label col-sm-3">手机号</label>
						<div class="col-sm-9">
							<div class="form-control-static">
								{$user['mobile']? substr_replace($user['mobile'], '****', 3, 4) : ''}
								{empty name="user.mobile"}
									<a href="{:url('change_mobile')}"><i class="icon-edit"></i>设置</a>
								{else/}
									<a href="{:url('change_mobile')}"><i class="icon-edit"></i>修改</a>
								{/empty}
							</div>
						</div>
					</div>
					<div class="form-group ">
						<label for="name" class="required control-label col-sm-3">密码</label>
						<div class="col-sm-9">
							<div class="form-control-static">
								{$user['is_set_password']? '已设置' : '未设置'}
								{empty name="user.is_set_password"}
									<a href="{:url('change_password')}"><i class="icon-edit"></i>设置</a>
								{else/}
									<a href="{:url('change_password')}"><i class="icon-edit"></i>修改</a>
								{/empty}
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="setting-city" class="control-label col-sm-3">所在城市</label>
						{:widget('Widget/area_select', ['城市', 1, 0, 0, 'province_id,city_id', $user['province_id'], $user['city_id']])}
					</div>

					<div class="form-group">
						<label for="setting-description" class="control-label col-sm-3">自我介绍</label>
						<div class="col-sm-9">
							<textarea name="description" class="form-control mono" rows="6">{$user['description']}</textarea>
						</div>
					</div>

					<div class="form-action row">
						<div class="col-sm-offset-3 col-sm-9">
							<button class="btn btn-xl btn-primary profile-sub" type="submit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

{include file="public/footer" /}